import React from 'react'
import { Button } from '@ant-design/react-native'
import { StyleSheet, View, Text, ViewStyle } from 'react-native'

interface ButtonDemoProps {
    onPress?: () => void;
    text?: string;
    textColor?: string;
    test?: boolean;
}

export default function ButtonDemo({ onPress, text = '按钮' , textColor = '#3366cc', test}: ButtonDemoProps) {
    return (
        <View>
            <Button
                style={test?styles.buttontest:styles.button}
                type="primary"
                onPress={onPress}
            >
                <Text style={[styles.buttonText, { color: textColor }]}>
                    {text}
                </Text>
            </Button>
        </View>
    )
};

const styles = StyleSheet.create({
    button: {
        marginBottom: 10,
        height: 40,
        width: 330,
        borderRadius: 20,
        backgroundColor: '#e6f0fa',
        borderColor: 'transparent',
        borderWidth: 0,
    },
    buttontest: {
        marginBottom: 10,
        height: 40,
        width: 330,
        borderRadius: 20,
        backgroundColor: '#e6f0fa',
        borderColor: 'transparent',
        borderWidth: 0,
    },
    buttonText: {
        // color: '#3366cc',
        fontWeight: 'bold',
        fontSize: 16,
    },
})